<?
include("core/base.php");

$bd=new bd();
$sQuery="SELECT * FROM uptime_regdate_stats";
$bd->query($sQuery);

$r=$bd->getResultatObj();

foreach ($r as $k => $v)
{
    $u=$v->username;
    $m=$v->machine;
    
    $sQuery="UPDATE uptime_regdate_stats SET max_reg_date=(SELECT MAX(reg_date) FROM uptime u WHERE u.username='".$u."' AND u.machine='".$m."') WHERE username='".$u."' AND machine='".$m."'";

    $bd->query($sQuery);
    echo ("<br/>".$sQuery);
}

?>
